package cn.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class CreatOrderNum {
	/*
	 * 输入uid后根据日期毫秒数生成order编号
	 */
	public static String getOrderNumByUid(Integer uid) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		String date = sdf.format(new Date());
		Random ne = new Random();//实例化一个random的对象ne
        int x = ne.nextInt(9000)+1000;//为变量赋随机值1000-9999
		String uniqueCode = String.valueOf(x);
		return date+uniqueCode+uid;
	}
}
